#include <iostream>
#include <string>

class MyStack;

class listNode{
    friend class MyStack;
private:
    listNode* next;
    int data;
public:
    ~listNode();
    listNode();
    listNode(int nodeData, listNode* succ = NULL);
};

class MyStack
{
private:
    listNode* topNode;
    int stackSize;

public:
    MyStack();
    ~MyStack();

    bool push(const int& a);
    bool pop(int& a);
    bool getTop(int& a);
    void printStack();
};

class MyQueue
{
private:
    int* queue;
    int capacity;
    int front;
    int rear;

public:
    MyQueue(const int& a);
    ~MyQueue();
    MyQueue();
    bool enQueue(const int& a);
    bool deQueue(int& a);
    bool getFront(int& a);
    void printQueue();

    bool isFull();
};

int inoppower(char ch);

int outoppower(char ch);


bool postfixExpression(const std::string& s1, std::string& s2);

class chNode{
    friend class OPStack;
private:
    chNode* next;
    char data;
public:
    ~chNode();
    chNode();
    chNode(char nodeData, chNode* succ = NULL);
};

class OPStack
{
private:
    chNode* topNode;
    int stackSize;

public:
    OPStack();
    ~OPStack();

    bool push(const char& a);
    bool pop(char& a);
    char getTop( );
};

bool expressionVal(const std::string& , int&);

float compute(int a, int b, char c);
void yanghui(const int&);



